$OpenBSD: patch-kcheckpass_kcheckpass_c,v 1.2 2014/01/28 14:49:26 zhuk Exp $
Add support for BSD auth.
--- kcheckpass/kcheckpass.c.orig	Wed Jun 23 11:51:26 2010
+++ kcheckpass/kcheckpass.c	Wed Jun 23 11:54:29 2010
@@ -57,6 +57,10 @@
 #include <errno.h>
 #include <time.h>
 
+#ifdef HAVE_READPASSPHRASE
+#include <readpassphrase.h>
+#endif
+
 /* Compatibility: accept some options from environment variables */
 #define ACCEPT_ENV
 
@@ -91,11 +95,15 @@ conv_legacy (ConvRequest what, const char *prompt)
 	if (havetty) {
 #ifdef HAVE_GETPASSPHRASE
 	    p = getpassphrase(prompt ? prompt : "Password: ");
+#elif defined HAVE_READPASSPHRASE
+	    p = readpassphrase(prompt ? prompt : "Password: ",
+	    	buf, sizeof buf, RPP_REQUIRE_TTY);
 #else
 	    p = getpass(prompt ? prompt : "Password: ");
 #endif
 	    p2 = strdup(p);
 	    memset(p, 0, strlen(p));
+	    memset(buf, 0, sizeof buf);
 	    return p2;
 	} else {
 	    if (prompt)
